#-- coding=utf-8 ---*---
__author__ = 'wenke1'

import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')


#假设需要处理的文件为当前目录的sever.log20160616文件
curdir=os.getcwd()
filename='server.log2016061614'
filePath=os.path.join(curdir,filename)

#open file
fp=open(filePath)

filterStr='LY IDEA EXCEPTION'
for line in fp:
    if filterStr in line:
        print "server error"

fp.close()